1. Technical Field
The present invention relates to an image compressing method, an image compressing apparatus and an image forming apparatus in which a color image is compressed.
2. Description of Related Art
Digital image processing systems have been remarkably developed in recent years, and establishment of digital image processing techniques has been proceeded. In the field of, for example, copying machines and multi-function printers employing an electrophotographic method or an inkjet method, a document of a manuscript is read with a scanner to be stored as a document file of electronic data and the thus stored document file is managed. Furthermore, a document file is compressed to be submitted with an e-mail. Since an image read with a scanner (hereinafter referred to as a scanned image) has a large file size in general, it is indispensable to compress a scanned image for storage or transmission.
As one compression technique for compressing such an image in a high compression ratio, an image compression technique based on layer segmentation such as Mixed Raster Content (MRC) has been put to practical use. In the image compression technique based on the layer segmentation, a foreground mask corresponding to a text and/or a line drawing is extracted from a color image to be compressed, the color image is separated into a foreground layer and a background layer on the basis of the extracted foreground mask, and the foreground layer and the background layer are respectively compressed by employing suitable compression techniques, so as to ultimately generate a highly compressed image (see Japanese Patent Application Laid-Open No. 2002-94805).
At this point, a foreground layer is a layer of a foreground corresponding to a text and/or a line drawing and is generally compressed by employing a lossless compression technique such as JBIG (Joint Bilevel Image Group), MMR (Modified Modified Read code) or LZW (Lempel Ziv Welch). On the other hand, a background layer is a layer of a background corresponding to an image content other than the text and/or line drawing and is generally compressed by employing a lossy compression technique such as JPEG (Joint Photographic Experts Group). In compression attained by the lossy compression technique, the image quality of a compressed image is more largely degraded than in compression attained by the lossless compression technique. Since the compression ratio is easily controlled in the lossy compression technique, however, priority can be placed on a small file size or high image quality in accordance with the use of a compressed image. On the contrary, since the compression ratio is difficult to control in the lossless compression technique, it is difficult to improve the compression ratio by employing this technique.
In one conventionally proposed image compressing apparatus, a foreground layer separated from a color image is further separated before subjecting it to the lossless compression, and thus, the compression ratio can be improved as compared with the case where the foreground layer is directly subjected to the lossless compression. In this image compressing apparatus, one foreground layer is generated by replacing colors of a foreground of one color image with N (wherein N is a natural number) kinds of identifiers, the generated foreground layer is separated into N binary images respectively corresponding to the N kinds of identifiers, and the separated binary images are individually subjected to the lossless compression.
Alternatively, in another image compressing apparatus conventionally disclosed, a first compression mode suitable for compression of a color image including a small number of colors and a second compression mode suitable for compression of a color image including both a text and a non-text are provided so as to select one of the compression modes manually by a user or automatically by the apparatus itself (see Japanese Patent Application Laid-Open No. 2004-229261). In this image compressing apparatus, a text area and a non-text area of a color image are distinguished from each other in the second compression mode, so as to perform color decreasing processing for converting each pixel of the text area (i.e., a foreground) into an index (identifier) provided correspondingly to a color value (color information).
In the case where the number of colors of the text area is decreased to one through the color decreasing processing (namely, a color image can be changed into a binary image through color decrease), the binary image is subjected to the MMR compression of the lossless compression, and in the case where the number of colors of the text area is decreased to two or more and a prescribed number or less (namely, a color image can be converted into a multilevel image including a smaller number of colors through the color decrease), the multilevel image is subjected to the ZIP compression of the lossless compression. On the other hand, in the case where the number of colors of the text area is not decreased to the prescribed number or less (namely, a color image is converted merely to a multilevel image including a large number of colors through the color decrease), the original color image obtained before the color decreasing processing is subjected to the JPEG compression of the lossy compression.